package com.jr.serviceimpl;

import com.jr.dao.BlackListDao;
import com.jr.daoimpl.BlackListDaoImpl;
import com.jr.entity.Enterprise;
import com.jr.pojo.BeQuery;
import com.jr.pojo.BlackEnterprise;
import com.jr.pojo.WhiteEnterprise;
import com.jr.service.BlackListService;
import util.PageHelper;

import java.util.ArrayList;

public class BlackListServiceImpl implements BlackListService {

    BlackListDao blackListDao = new BlackListDaoImpl();


    @Override
    public int countTotalData(BeQuery beQuery, int enterprise_id) {
        return blackListDao.countTotalData(beQuery,enterprise_id);
    }

    @Override
    public ArrayList<BlackEnterprise> findIndexPageData(PageHelper pageHelper, BeQuery beQuery, int enterprise_id) {
        return blackListDao.selectIndexPageData(pageHelper,beQuery,enterprise_id);
    }


    @Override
    public ArrayList selectBlackSupName(int eid) {
        return blackListDao.selectBlackSupName(eid);
    }


    @Override
    public Enterprise selectCodeByName(String enamess) {
        return blackListDao.selectCodeByName(enamess);
    }


    @Override
    public boolean addSup(int enterprise_id, int supplier_id, String reason, String update_date) {
        return blackListDao.addSup(enterprise_id,supplier_id,reason,update_date)>0;
    }


    @Override
    public boolean delSup(int enterprise_id, int supplier_id) {
        return blackListDao.delSup(enterprise_id, supplier_id)>0;
    }
}
